{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "ZrwVQsM9TiUw"
      },
      "source": [
        "##### Copyright 2019 The TensorFlow Authors.\n",
        "\n",
        "Licensed under the Apache License, Version 2.0 (the \"License\");"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "CpDUTVKYTowI"
      },
      "outputs": [],
      "source": [
        "#@title Licensed under the Apache License, Version 2.0 (the \"License\"); { display-mode: \"form\" }\n",
        "# you may not use this file except in compliance with the License.\n",
        "# You may obtain a copy of the License at\n",
        "#\n",
        "# https://www.apache.org/licenses/LICENSE-2.0\n",
        "#\n",
        "# Unless required by applicable law or agreed to in writing, software\n",
        "# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
        "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
        "# See the License for the specific language governing permissions and\n",
        "# limitations under the License."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "ltPJCG6pAUoc"
      },
      "source": [
        "# TFP Probabilistic Layers: Variational Auto Encoder\n",
        "\n",
        "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
        "  \u003ctd\u003e\n",
        "    \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/probability/blob/master/tensorflow_probability/examples/jupyter_notebooks/Probabilistic_Layers_VAE.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
        "  \u003c/td\u003e\n",
        "  \u003ctd\u003e\n",
        "    \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/probability/blob/master/tensorflow_probability/examples/jupyter_notebooks/Probabilistic_Layers_VAE.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView source on GitHub\u003c/a\u003e\n",
        "  \u003c/td\u003e\n",
        "\u003c/table\u003e"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "WRVR-tGTR31S"
      },
      "source": [
        "In this example we show how to fit a Variational Autoencoder using TFP's \"probabilistic layers.\""
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "uiR4-VOt9NFX"
      },
      "source": [
        "### Dependencies \u0026 Prerequisites\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "Cg5t0lWXGY0z"
      },
      "outputs": [],
      "source": [
        "#@title Install { display-mode: \"form\" }\n",
        "TF_Installation = 'TF2 Nightly (GPU)' #@param ['TF2 Nightly (GPU)', 'TF2 Stable (GPU)', 'TF1 Nightly (GPU)', 'TF1 Stable (GPU)','System']\n",
        "\n",
        "if TF_Installation == 'TF2 Nightly (GPU)':\n",
        "  !pip install -q --upgrade tf-nightly-gpu-2.0-preview\n",
        "  print('Installation of `tf-nightly-gpu-2.0-preview` complete.')\n",
        "elif TF_Installation == 'TF2 Stable (GPU)':\n",
        "  !pip install -q --upgrade tensorflow-gpu==2.0.0-alpha0\n",
        "  print('Installation of `tensorflow-gpu==2.0.0-alpha0` complete.')\n",
        "elif TF_Installation == 'TF1 Nightly (GPU)':\n",
        "  !pip install -q --upgrade tf-nightly-gpu\n",
        "  print('Installation of `tf-nightly-gpu` complete.')\n",
        "elif TF_Installation == 'TF1 Stable (GPU)':\n",
        "  !pip install -q --upgrade tensorflow-gpu\n",
        "  print('Installation of `tensorflow-gpu` complete.')\n",
        "elif TF_Installation == 'System':\n",
        "  pass\n",
        "else:\n",
        "  raise ValueError('Selection Error: Please select a valid '\n",
        "                   'installation option.')"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "9clSiUTiT3G1"
      },
      "outputs": [],
      "source": [
        "#@title Install { display-mode: \"form\" }\n",
        "TFP_Installation = \"Nightly\" #@param [\"Nightly\", \"Stable\", \"System\"]\n",
        "\n",
        "if TFP_Installation == \"Nightly\":\n",
        "  !pip install -q tfp-nightly\n",
        "  print(\"Installation of `tfp-nightly` complete.\")\n",
        "elif TFP_Installation == \"Stable\":\n",
        "  !pip install -q --upgrade tensorflow-probability\n",
        "  print(\"Installation of `tensorflow-probability` complete.\")\n",
        "elif TFP_Installation == \"System\":\n",
        "  pass\n",
        "else:\n",
        "  raise ValueError(\"Selection Error: Please select a valid \"\n",
        "                   \"installation option.\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "kZ0MdF1j8WJf"
      },
      "outputs": [],
      "source": [
        "#@title Import { display-mode: \"form\" }\n",
        "\n",
        "from __future__ import absolute_import\n",
        "from __future__ import division\n",
        "from __future__ import print_function\n",
        "\n",
        "import numpy as np\n",
        "\n",
        "import tensorflow as tf\n",
        "from tensorflow.python import tf2\n",
        "if not tf2.enabled():\n",
        "  import tensorflow.compat.v2 as tf\n",
        "  tf.enable_v2_behavior()\n",
        "  assert tf2.enabled()\n",
        "\n",
        "import tensorflow_datasets as tfds\n",
        "import tensorflow_probability as tfp\n",
        "\n",
        "\n",
        "tfk = tf.keras\n",
        "tfkl = tf.keras.layers\n",
        "tfpl = tfp.layers\n",
        "tfd = tfp.distributions"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "7nnwjUdVoWN2"
      },
      "source": [
        "### Make things Fast!"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "2CK9RaDcoYPG"
      },
      "source": [
        "Before we dive in, let's make sure we're using a GPU for this demo.  \n",
        "\n",
        "To do this, select \"Runtime\" -\u003e \"Change runtime type\" -\u003e \"Hardware accelerator\" -\u003e \"GPU\".\n",
        "\n",
        "The following snippet will verify that we have access to a GPU."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "qP_4Xr8vpA42"
      },
      "outputs": [],
      "source": [
        "if tf.test.gpu_device_name() != '/device:GPU:0':\n",
        "  print('WARNING: GPU device not found.')\n",
        "else:\n",
        "  print('SUCCESS: Found GPU: {}'.format(tf.test.gpu_device_name()))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "FJRBc_S0ppfE"
      },
      "source": [
        "Note: if for some reason you cannot access a GPU, this colab will still work. (Training will just take longer.)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "N8Shtn_e99XC"
      },
      "source": [
        "### Load Dataset"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "daPl6ycN9cD3"
      },
      "outputs": [],
      "source": [
        "datasets, datasets_info = tfds.load(name='mnist',\n",
        "                                    with_info=True,\n",
        "                                    as_supervised=False)\n",
        "\n",
        "def _preprocess(sample):\n",
        "  image = tf.cast(sample['image'], tf.float32) / 255.  # Scale to unit interval.\n",
        "  image = image \u003c tf.random.uniform(tf.shape(image))   # Randomly binarize.\n",
        "  return image, image\n",
        "\n",
        "train_dataset = (datasets['train']\n",
        "                 .map(_preprocess)\n",
        "                 .batch(256)\n",
        "                 .prefetch(tf.data.experimental.AUTOTUNE)\n",
        "                 .shuffle(int(10e3)))\n",
        "eval_dataset = (datasets['test']\n",
        "                .map(_preprocess)\n",
        "                .batch(256)\n",
        "                .prefetch(tf.data.experimental.AUTOTUNE))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "CI-VFyp8-BIa"
      },
      "source": [
        "### VAE Code Golf"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "MKgRI5eoS2rx"
      },
      "source": [
        "#### Specify model."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "rd3Voa64_Gtv"
      },
      "outputs": [],
      "source": [
        "input_shape = datasets_info.features['image'].shape\n",
        "encoded_size = 16\n",
        "base_depth = 32"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "9d7Jbm66FN_u"
      },
      "outputs": [],
      "source": [
        "prior = tfd.Independent(tfd.Normal(loc=tf.zeros(encoded_size), scale=1),\n",
        "                        reinterpreted_batch_ndims=1)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "eRHjRtAL-e33"
      },
      "outputs": [],
      "source": [
        "encoder = tfk.Sequential([\n",
        "    tfkl.InputLayer(input_shape=input_shape),\n",
        "    tfkl.Lambda(lambda x: tf.cast(x, tf.float32) - 0.5),\n",
        "    tfkl.Conv2D(base_depth, 5, strides=1,\n",
        "                padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2D(base_depth, 5, strides=2,\n",
        "                padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2D(2 * base_depth, 5, strides=1,\n",
        "                padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2D(2 * base_depth, 5, strides=2,\n",
        "                padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2D(4 * encoded_size, 7, strides=1,\n",
        "                padding='valid', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Flatten(),\n",
        "    tfkl.Dense(tfpl.MultivariateNormalTriL.params_size(encoded_size),\n",
        "               activation=None),\n",
        "    tfpl.MultivariateNormalTriL(\n",
        "        encoded_size,\n",
        "        activity_regularizer=tfpl.KLDivergenceRegularizer(prior)),\n",
        "])"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "baP--pt6-ewK"
      },
      "outputs": [],
      "source": [
        "decoder = tfk.Sequential([\n",
        "    tfkl.InputLayer(input_shape=[encoded_size]),\n",
        "    tfkl.Reshape([1, 1, encoded_size]),\n",
        "    tfkl.Conv2DTranspose(2 * base_depth, 7, strides=1,\n",
        "                         padding='valid', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2DTranspose(2 * base_depth, 5, strides=1,\n",
        "                         padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2DTranspose(2 * base_depth, 5, strides=2,\n",
        "                         padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2DTranspose(base_depth, 5, strides=1,\n",
        "                         padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2DTranspose(base_depth, 5, strides=2,\n",
        "                         padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2DTranspose(base_depth, 5, strides=1,\n",
        "                         padding='same', activation=tf.nn.leaky_relu),\n",
        "    tfkl.Conv2D(filters=1, kernel_size=5, strides=1,\n",
        "                padding='same', activation=None),\n",
        "    tfkl.Flatten(),\n",
        "    tfpl.IndependentBernoulli(input_shape, tfd.Bernoulli.logits),\n",
        "])"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "7itugvZVLyWL"
      },
      "outputs": [],
      "source": [
        "vae = tfk.Model(inputs=encoder.inputs,\n",
        "                outputs=decoder(encoder.outputs[0]))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "-ckYuzfILkVb"
      },
      "source": [
        "#### Do inference."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {
          "height": 590
        },
        "colab_type": "code",
        "executionInfo": {
          "elapsed": 269250,
          "status": "ok",
          "timestamp": 1551300684365,
          "user": {
            "displayName": "",
            "photoUrl": "",
            "userId": ""
          },
          "user_tz": 480
        },
        "id": "e7f1u-Ya-axQ",
        "outputId": "e989c831-6075-4ebd-b628-b9f80e820a90"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Epoch 1/15\n",
            "235/235 [==============================] - 22s 94ms/step - loss: 236.9404 - val_loss: 0.0000e+00\n",
            "Epoch 2/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 76ms/step - loss: 151.2015 - val_loss: 145.6309\n",
            "Epoch 3/15\n",
            "235/40 [================================================================================================================================================================================] - 17s 74ms/step - loss: 142.7853 - val_loss: 139.8294\n",
            "Epoch 4/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 75ms/step - loss: 135.4361 - val_loss: 133.8475\n",
            "Epoch 5/15\n",
            "235/40 [================================================================================================================================================================================] - 17s 74ms/step - loss: 132.1213 - val_loss: 128.8696\n",
            "Epoch 6/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 75ms/step - loss: 127.6682 - val_loss: 125.9351\n",
            "Epoch 7/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 75ms/step - loss: 125.0283 - val_loss: 124.2726\n",
            "Epoch 8/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 75ms/step - loss: 125.5399 - val_loss: 122.4221\n",
            "Epoch 9/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 77ms/step - loss: 122.6315 - val_loss: 122.0207\n",
            "Epoch 10/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 75ms/step - loss: 121.1640 - val_loss: 121.2397\n",
            "Epoch 11/15\n",
            "235/40 [================================================================================================================================================================================] - 17s 74ms/step - loss: 121.1660 - val_loss: 120.0015\n",
            "Epoch 12/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 75ms/step - loss: 118.0253 - val_loss: 119.6703\n",
            "Epoch 13/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 76ms/step - loss: 121.2379 - val_loss: 119.0393\n",
            "Epoch 14/15\n",
            "235/40 [================================================================================================================================================================================] - 17s 74ms/step - loss: 118.8705 - val_loss: 118.2071\n",
            "Epoch 15/15\n",
            "235/40 [================================================================================================================================================================================] - 18s 75ms/step - loss: 118.2430 - val_loss: 118.1639\n"
          ]
        },
        {
          "data": {
            "text/plain": [
              "\u003cgoogle3.third_party.tensorflow.python.keras.callbacks.History at 0x7fd229744fd0\u003e"
            ]
          },
          "execution_count": 10,
          "metadata": {
            "tags": []
          },
          "output_type": "execute_result"
        }
      ],
      "source": [
        "negloglik = lambda x, rv_x: -rv_x.log_prob(x)\n",
        "\n",
        "vae.compile(optimizer=tf.optimizers.Adam(learning_rate=1e-3),\n",
        "            loss=negloglik)\n",
        "\n",
        "vae.fit(train_dataset,\n",
        "        epochs=15,\n",
        "        validation_data=eval_dataset)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "hC4rNz9t_zpo"
      },
      "source": [
        "### Look Ma, No ~~Hands~~Tensors!"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "3ZqfOYMP_2p_"
      },
      "outputs": [],
      "source": [
        "# We'll just examine ten random digits.\n",
        "x = next(iter(eval_dataset))[0][:10]\n",
        "xhat = vae(x)\n",
        "assert isinstance(xhat, tfd.Distribution)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "cellView": "form",
        "colab": {},
        "colab_type": "code",
        "id": "MM7wW4S2OrBt"
      },
      "outputs": [],
      "source": [
        "#@title Image Plot Util\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "def display_imgs(x, y=None):\n",
        "  if not isinstance(x, (np.ndarray, np.generic)):\n",
        "    x = np.array(x)\n",
        "  plt.ioff()\n",
        "  n = x.shape[0]\n",
        "  fig, axs = plt.subplots(1, n, figsize=(n, 1))\n",
        "  if y is not None:\n",
        "    fig.suptitle(np.argmax(y, axis=1))\n",
        "  for i in xrange(n):\n",
        "    axs.flat[i].imshow(x[i].squeeze(), interpolation='none', cmap='gray')\n",
        "    axs.flat[i].axis('off')\n",
        "  plt.show()\n",
        "  plt.close()\n",
        "  plt.ion()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {
          "height": 428
        },
        "colab_type": "code",
        "executionInfo": {
          "elapsed": 1554,
          "status": "ok",
          "timestamp": 1551300691476,
          "user": {
            "displayName": "",
            "photoUrl": "",
            "userId": ""
          },
          "user_tz": 480
        },
        "id": "ow7rfh6YLLx1",
        "outputId": "29c2f6a9-f53b-43bc-9d09-155a699d9be7"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Originals:\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAABVCAYAAABkbMGmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAB+hJREFUeJzt3dtyozgQAFCc5Ivm/38tYR62qNIyQgjcwWp8ztOuN+tC\n1oVWS4jHPM/zBABAiI9XXwAAwJ0IrgAAAgmuAAACCa4AAAIJrgAAAgmuAAACCa4AAAIJrgAAAgmu\nAAACCa4AAAIJrgAAAgmuAAACCa4AAAIJrgAAAgmuAAACfb36AqLM8zx9fNRjxcfjMf38/Fx8RQDA\nO3rM8zy/+iLOWC57K6Dac6eAq/VbPB6PaZqmW5X1Hcp5V/M8T5+fn9M0TdP39/c0TdP0+fmp3gai\nj91TeZ9Ql7/PsiAAQKC0y4JL5F3Ofo9Y/r9sjmbsyr/POEvpLW/GBOxyzWUmZ13OO84wa+VmfBn7\nGPUx9G59bl3GEVamZK4AAAKl3XO11ipGuc9jMUJk26s3e7OUp1be8ntG98x+uiyZntYDGHuylLGm\nVu4s7fJd7LVN9ZXTMl58fn6mHkNqaveMV5cx7bLg2vJD9sowQBwNqpbf4PF4nF4ufZVngo3194ys\nVaflILBeOqt9RybPPoDCdTKOH2dE3JBHvKmv1caSjGPIUeu6ubo+jHQAAIFuk7k6apRZRYRa1u5o\nJu9qZzMZ39/f1Uf51141W6nZy8qtM4/lP+8t9Y7uHTJWd3vEPWtb69Vqk8t/e2b8fIes0Cu0soSt\nDfplnV7ZP+874gEAvMDbZq7ucn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uWUn8h79m8eJyFwBAAQaPnPV+1j3M3sdRnjnUm3Wf/TohL09LyPNoJ/Z\nS1Qr5yiviynba1lvR98JmVFr38ooWdOj9rLeW0bLnL6roxu271hfmbNytftixCb8K8aj4YOrrSWu\n5bNW4JXxzKDWyyXLZcvyN+n5La7+Dfbe47SUqbVhsbYEuFXGEes6YjNmdu8aZIzYHo/IfEMu9dTD\nnc9lK21tRZim8dtpee0RdXrFeHT/FgUAcKHhM1dbG9VbM6nRo/CW3oxPGZX3PGL6isxBz6nktc2n\nre+qGam+a/X3TBp7pLJtaS1Hv1vGapHpQYSWvfobPfOxroczWapRyxZh9HZaG1ueueYr61LmCgAg\n0PCZq/Jk1tqG2Vokmn223JPx2TPSb3C2PFuP9I+QlWtZX8/Wo+E9h25m3buT7XqjvUv5R8p8tPaJ\nHR0jyvobbXyJNHo77T3epWcsvfpYlMc8Uu/oVF7ynRv+otz83fsk1si/yzzPh09EzjjYLdd8Jjge\nPYAsRafus3nmfKUsfn5+/lnmrgUvI5S3rI+eCV3tJP6R+9tZmfvp1nLuOqAe6Qlyy4IAAIFSZq7e\nWa26Ms+yeptf9jL2Zuoyz5zfLaO8VmZ3FncaXssjYcp/L41U7+Wp3q16eDwe/5TtzrL209rDCUt/\nW2ewys9eReYKACCQzBVcaK+7vXq2xXnlvpDMGUjIYj2ejtTfBFcAQZag6uvr63//DrwXy4IAAIGG\nP+cKIIueDdTA/QmuAIL9+fPn1ZcAvJA9VwAAgey5AgAIJLgCAAgkuAIACCS4AgAIJLgCAAgkuAIA\nCCS4AgAIJLgCAAgkuAIACCS4AgAIJLgCAAgkuAIACCS4AgAIJLgCAAgkuAIACCS4AgAIJLgCAAgk\nuAIACCS4AgAIJLgCAAgkuAIACCS4AgAIJLgCAAgkuAIACCS4AgAIJLgCAAj0F61yKS5hunquAAAA\nAElFTkSuQmCC\n",
            "text/plain": [
              "\u003cmatplotlib.figure.Figure at 0x7fd213212790\u003e"
            ]
          },
          "metadata": {
            "tags": []
          },
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Decoded Random Samples:\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAABVCAYAAABkbMGmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACRBJREFUeJzt3VF3o6wWAFDS9v//4rT5Hu5yLoseFROqQPZ+mjWTdiSg\nHg54vD0ej0cCAKCJj6sPAABgJoIrAICGBFcAAA0JrgAAGhJcAQA0JLgCAGhIcAUA0JDgCgCgIcEV\nAEBDgisAgIYEVwAADQmuAAAaElwBADT0NsHV4/FIj8cjfXx8pI+Pt2k2AHAyUQYAQEO3x+PxuPog\nWlma8vn5mVJK6efnZ/Uzt9vtvAMDAN7G19UH8KolWIqW+qIAavm7KPAayV67R29fKQ+cv7+///05\npfH7EnoTXV9muXa+u8fjMf21s4c2WhYEAGho+MxVjZ+fn19Lhh8fH1NH7cuMc7Y25qvY+ex6xHbW\nZF3zLN0MGbt8bM6cCcn7dpZ2TrSD5O2V157Rx2bk6vEqcwUA0NDwmat8hr/M6MsZfpQZWD4zmq1s\nR2609uUZjUjez+XnRsrU1fZf9LlyfI8kas/VM8uz3O/3lNLcWYLZHN2z08Menz3ROTjL2Czbdrvd\n/l0n873XZ2aRhw+uFvnSUPkF5gM///xo6fq9ACRv72xLL9ESYL7Uu/y55onRK0WTgVzN0t9sT7qO\nuqxb6+vrf5fZ/EY2c3tHdOTBqPzGnU94RpwsLGNz1Anb2v3wfr//alt+nziDZUEAgIamqnO1Zi3C\nLTNdvTq6lJTS/9u2zKx66uY8k7jMKv6qan4v7Y7S1ksmI89SlZnGKLu1GKnkxtYYztvdu6gkSO3Y\nzbOrPbd3L0O+GGn85Y5urYjOweV3ROdpL9ec0la7ez3mSG3/lZ//+fn5109nrOjIXAEANPQWmauU\nfs8w8oi11/05NRF6fsz5bDjKlPTSvtqZcUrbVfa3sjrlZ69Qm62J3hpQ/u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OAKAKAhwRUAQEOCKwCAhgRXAAANCa4AABoS\nXAEANCS4AgBoSHAFANCQ4AoAoCHBFQBAQ4IrAICGBFcAAA0JrgAAGhJcAQA0JLgCAGhIcAUA0NB/\n2tEAJ5JZHdAAAAAASUVORK5CYII=\n",
            "text/plain": [
              "\u003cmatplotlib.figure.Figure at 0x7fd21ec6d7d0\u003e"
            ]
          },
          "metadata": {
            "tags": []
          },
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Decoded Modes:\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAABVCAYAAABkbMGmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAABk5JREFUeJzt3cGSozYQAFDhzf//8ZgcUtRSE4wFbht1+71TDpktyYKm\n1RJimud5bgAAhLhd3QAAgEokVwAAgSRXAACBJFcAAIEkVwAAgSRXAACBJFcAAIEkVwAAgSRXAACB\nJFcAAIEkVwAAgSRXAACBJFcAAIEkVwAAgSRXAACBSiZX8zy3eZ7bNE1tmqZ2u5XsJgAwoGme5/nq\nRkSY57kriZqmqbXW2v1+f3eTPuJRv6v1kzqWkPPnz5/Wmmt0RMsYrWOLmAL9lHQAAAL9c3UDPi17\noW5rRtnz/2Wdbfb0d5qmtP1rrX9MK1QOeivMjCd77OQ/63uwQkxZG6niKsoBAAQqU7mapqn9/Py0\n1v7u5dhzu93SZetnZv2ZZpu9FZytv8tSoTvbx/XfLjOx7BW7ytbjXK06QE5bsSfT82FLTzxdx81P\n3otlkqvWHi+BzfP8v4Qr+0W11tPfUZPJV5KNvX9ntL729nNrLFvbnjBkuoajxnl0FR9g1UUtVUui\nP+uVYsMnnhO1Ix0AwIeVqlwtlhlEFc9m/b/7u7VEOtrs+V2VjBErWM9mWOs2Vrt2v8G3VOWq+KbY\nU1HE+H3ieSgaAAAEKlm5qqInQ380O9qqgIwyo3plj8O67dn3Iy19OVutunocX5Wx/ap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pax55veGXvaZW\nvgHW/d46hyXjcujSj6PnykSfnv1OS1sjEsmRb9OtwJbxZZJXPVqKGHnsjti6nkfu2/1+Px1XKl63\newnIyOO4OBtPr4pFlgUBAAKlqlzx13rYKsyyei/DjH2d5/nlCl2Gfle7Jo+qXrlaZBrnynHlrHVF\nL2OFubeCdXXfVK4AAAKpXMEHmUnX9ntWneFlC75PxBEVV3sWS6/um+QKIFiFhxdwnmVBAIBAZc65\nAhiFihV8N5UrAIBAkisAgECSKwCAQJIrAIBAkisAgECSKwCAQJIrAIBAkisAgECSKwCAQJIrAIBA\nkisAgECSKwCAQJIrAIBAkisAgECSKwCAQJIrAIBAkisAgECSKwCAQJIrAIBAkisAgECSKwCAQJIr\nAIBAkisAgECSKwCAQJIrAIBAkisAgECSKwCAQJIrAIBA/wL4Db4ox7rOKAAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "\u003cmatplotlib.figure.Figure at 0x7fd21ec6dcd0\u003e"
            ]
          },
          "metadata": {
            "tags": []
          },
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Decoded Means:\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAABVCAYAAABkbMGmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHuBJREFUeJztnXuQlXUZxz9nl73AAovcQUHIRRGISvGSGpqW40CNmPcL\nxnjJzMrJZrJmmjGzxnSsdKRMC4upDMtrCkkKKohBAaLETVQEFHRZWHSXy+6ePac/3vk+57fnHC7q\n2bPvsefzz65nl/V939/lfZ7vc/kl0ul0GsdxHMdxHKcglHX1BTiO4ziO43yccOPKcRzHcRyngLhx\n5TiO4ziOU0DcuHIcx3Ecxykgblw5juM4juMUEDeuHMdxHMdxCogbV47jOI7jOAXEjSvHcRzHcZwC\n4saV4ziO4zhOAXHjynEcx3Ecp4C4ceU4juM4jlNA3LhyHMdxHMcpIG5cOY7jOI7jFJ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YHu7cMqsnG77/3dR9yutTPQ/Tc1NfH4\n448DsG7dOgBOP/10O/9U+Uv/D8+kK/m4Kf6FIl+UIDtHNa73va8x3dfn+7qPohZ1uXHlOF3D/2u4\n++NG+NJSvyR9rayszDk+y8fU6Ury7TulOic/qHFVTDws6DiO4ziOU0BcuXIcxykAB9pK4+BNO45T\nHFy5chzHcRzHKSCxbSLqOI5TSrgy5TiOcOXKcRzHcRyngLhx5TiO4ziOU0DcuHIcx3Ecxykgblw5\njuM4juMUEDeuHMdxHMdxCogbV47jOI7jOAXEjSvHcRzHcZwC4saV4ziO4zhOAXHjynEcx3Ecp4C4\nceU4juM4jlNA3LhyHMdxHMcpIG5cOY7jOI7jFBA3rhzHcRzHcQqIG1eO4ziO4zgFxI0rx3Ecx3Gc\nAuLGleM4juM4TgFx48pxHMdxHKeAuHHlOI7jOI5TQNy4chzHcRzHKSBuXDmO4ziO4xQQN64cx3Ec\nx3EKiBtXjuM4juM4BcSNK8dxHMdxnALixpXjOI7jOE4BcePKcRzHcRyngLhx5TiO4ziOU0D+B+re\nTfkB2c7fAAAAAElFTkSuQmCC\n",
            "text/plain": [
              "\u003cmatplotlib.figure.Figure at 0x7fd2192e99d0\u003e"
            ]
          },
          "metadata": {
            "tags": []
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "print('Originals:')\n",
        "display_imgs(x)\n",
        "\n",
        "print('Decoded Random Samples:')\n",
        "display_imgs(xhat.sample())\n",
        "\n",
        "print('Decoded Modes:')\n",
        "display_imgs(xhat.mode())\n",
        "\n",
        "print('Decoded Means:')\n",
        "display_imgs(xhat.mean())"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {},
        "colab_type": "code",
        "id": "C3_5HPUCQpYO"
      },
      "outputs": [],
      "source": [
        "# Now, let's generate ten never-before-seen digits.\n",
        "z = prior.sample(10)\n",
        "xtilde = decoder(z)\n",
        "assert isinstance(xtilde, tfd.Distribution)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 0,
      "metadata": {
        "colab": {
          "height": 325
        },
        "colab_type": "code",
        "executionInfo": {
          "elapsed": 1159,
          "status": "ok",
          "timestamp": 1551300786264,
          "user": {
            "displayName": "",
            "photoUrl": "",
            "userId": ""
          },
          "user_tz": 480
        },
        "id": "_jMPwz8r9pYX",
        "outputId": "19f46823-9fa5-434b-a4f7-e9ffd4f250ab"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Randomly Generated Samples:\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAABVCAYAAABkbMGmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACV5JREFUeJzt3dF2q7gOgGGR9v2fOIFzcZb3KK4wdqKA5Pzf1azutIPB\nEFkW9rJt2yYAAABwcbv6AAAAAGZCcAUAAOCI4AoAAMARwRUAAIAjgisAAABHBFcAAACOCK4AAAAc\nEVwBAAA4IrgCAABwRHAFAADgiOAKAADAEcEVgLds2ybbtsntdpPb7fb03wDwjXj6AQAAOFq2bduu\nPggA+ZVHybIsT/8NII5t2+Tn50dERB6Ph4jIvyzzsiyyrutlxzYTMlcAAACOfq8+AAC5lSyVrrEq\nGStGwXModXQiXNvslmWR+/0uIvIvg8W19PfV04Kl6bN1MJ32naVNM9P9sKTpM16/cqzl2EX+axty\nBqHWMbcwrRSXvpal35Ug6/f3/3kWrp0fpgUBAAAcfc20YGvUWLIFM6kLijOOKK3Cy5+fn3Tt0Kws\nle6Tpb1lRFn+LXKb6wywpvufSOx2fEor+xMxs6enAI/UmdaI7cFf5TqVjNWM34G1s2d0yFwBAAA4\n+oqaKysDos32urg18lzXNXw7WyN8nWWs2xG9xmwkE1BYWdXIbRSxa67qY43eB731XvsrH8OjdVW9\nfw+xWNe53J+z3Ze9990nZ3SmCa5aa3doM09PZJt+2FOO1QqarIeAvpEitvOV4KrQ/TXq2lFWvyv3\n4LcXymYIrgorOC4ej4f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AAHH1F5kpHuBmbe3UEfobWGmb6Z5n09jXd3oztnEUrU1xwff6Tqb9aWclv\nyULOyspcRbqmZK4AAAAcfUXmSuQ7sj8A3sezYj7WLhcZ63DxrA5fIt2zXxNcAQC+kw6ushXhIyem\nBQEAAByRuQIAfIVMRfjIjcwVAACAI4IrAMBXIGuFsxBcAQAAOCK4AgAAcERwBQAA4IjgCgAAwBHB\nFQAAgCOCKwAAAEcEVwAAAI4IrgAAABwRXAEAADgiuAIAAHBEcAUAAOCI4AoAAMARwRUAAIAjgisA\nAABHBFcAAACOCK4AAAAcEVwBAAA4IrgCAABwRHAFAADgiOAKAADAEcEVAACAI4IrAAAARwRXAAAA\njgiuAAAAHBFcAQAAOCK4AgAAcPQ/PyV05PNk9oAAAAAASUVORK5CYII=\n",
            "text/plain": [
              "\u003cmatplotlib.figure.Figure at 0x7fd2130dbf50\u003e"
            ]
          },
          "metadata": {
            "tags": []
          },
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Randomly Generated Modes:\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAABVCAYAAABkbMGmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAABnpJREFUeJzt3dGy2ygMAFDS7v//ceN92EnrTYmDE8WR8DmPdzItGIyF\nwPiyLMvSAAAI8ePbBQAAmIngCgAgkOAKACCQ4AoAIJDgCgAgkOAKACCQ4AoAIJDgCgAgkOAKACCQ\n4AoAIJDgCgAgkOAKACCQ4AoAINA/3y4AAHCcZVlaa639+PFffuVyubTWWrter18r02xkrgAAAslc\nASHWs2EzYchpWZbfGav134gluJrU7Wb5+fNna81DLpveANdazfT8/RLD+m/80btO2du7V+ae7PVg\nm3aLZ1kQACCQzNWEHmVF+J7RDMD976rPKGepxzu22j5jhu+V8WNdxzO3dWZb/fCWeZzZul8fkWn1\nBAYACHSazFXv1VMzrFxGsjtnabdZMlgZMzNHq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IXN2s991sRaFbs8dK+5Puj/LvzUIq1OPeOgMX8a25WfbP7c0E\nZGn7XuZjq8/ey5rx2XNQaGt52mOvW1t9qvzZMiFn2Mj+altmvRdbez0r9637s1Rwtfbqhcracc4m\nckCvMCBG9rus9e2dr7Y1EGYNSmY8yypiuejd/7uCSmWN0HtDO7vbfTn61Ypv1cmyIABAoLKZq7PL\nmr3Ya+9m2t5STYbZ1qe/ATj6LcJs1rPM1v6fMclWjz2vsWdePtmyd9b/joxj1Fm+I/hsPKqUdX3k\nWdm/3aYyVwAAgWSuEhv5cnl16zr2ZhrVNp9Gt8sMM8zWap6mv2WG9hg5smavqhnWSmXd49G4Omt9\n175dx6mDq08v1XzDDA+n9due64F99GbIHHA8qtuIMwyC1eszw/13s377urWYulVs35natKdim7wr\nQ5taFgQACHRZZjkk6IlPn+XySesmqlj+EXu6YbVrMFq3avWa1VZ7aaOatrYXnOQROJ3eywmZVjVk\nrgAAAp0mcwXAuV2v17++Z5ohy8Fr7sOXTG0puALgNCpvEaEOy4IAAIGmPooBANZkrDiCzBUAQCDB\nFQBAIMEVAEAgwRUAQCDBFQBAIMEVAEAgwRUAQCDBFQBAIMEVAEAgwRUAQCDBFQBAIMEVAEAgwRUA\nQCDBFQBAIMEVAEAgwRUAQCDBFQBAIMEVAEAgwRUAQCDBFQBAIMEVAEAgwRUAQCDBFQBAIMEVAEAg\nwRUAQCDBFQBAIMEVAEAgwRUAQKB/ARfjrQqyL4pBAAAAAElFTkSuQmCC\n",
            "text/plain": [
              "\u003cmatplotlib.figure.Figure at 0x7fd218aa1a90\u003e"
            ]
          },
          "metadata": {
            "tags": []
          },
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Randomly Generated Means:\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAABVCAYAAABkbMGmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt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UarvXbiiScC8L3vfc8qdxdSGQKnP6klfVatWsUvf/lLIJ6zqsZ+wQUXWHpJvqIarlw5\njuM4juNkkd1GuYL0XCvlDXz44YdWnFFHbaurq9Mq0OazFEMmUrsmUyG/wehhDcSQK+T3sKP2FvKz\nf5L4OOPS+6zwSSaTVgJExSbvueceVqxYAUQ3A0BU7DQ8ru8UNuEhBUV31M/Ko/6oGx5yyW5lXIlM\nRonY2Uv6fr7qAAABZ0lEQVQ4C5GPqkzvOI7j9CcMx+tA0+rVqy0RWieWR4wYUVBXvTg7R6E7rW6m\nO47jOI7jZJHdUrlKpRBqVjmO4zi5JTVVJCzvEiav+77gZBtXrhzHcRzHcbLIJ0K5chzHcRzHyRWu\nXDmO4ziO42QRN64cx3Ecx3GyiBtXjuM4juM4WcSNK8dxHMdxnCzixpXjOI7jOE4WcePKcRzHcRwn\ni7hx5TiO4ziOk0XcuHIcx3Ecx8kiblw5juM4juNkETeuHMdxHMdxsogbV47jOI7jOFnEjSvHcRzH\ncZws4saV4ziO4zhOFnHjynEcx3EcJ4u4ceU4juM4jpNF3LhyHMdxHMfJIm5cOY7jOI7jZBE3rhzH\ncRzHcbKIG1eO4ziO4zhZxI0rx3Ecx3GcLOLGleM4juM4ThZx48pxHMdxHCeLuHHlOI7jOI6TRdy4\nchzHcRzHySJuXDmO4ziO42QRN64cx3Ecx3GyyP8Bzbu+c8pHN5wAAAAASUVORK5CYII=\n",
            "text/plain": [
              "\u003cmatplotlib.figure.Figure at 0x7fd21ce38650\u003e"
            ]
          },
          "metadata": {
            "tags": []
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "print('Randomly Generated Samples:')\n",
        "display_imgs(xtilde.sample())\n",
        "\n",
        "print('Randomly Generated Modes:')\n",
        "display_imgs(xtilde.mode())\n",
        "\n",
        "print('Randomly Generated Means:')\n",
        "display_imgs(xtilde.mean())"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "collapsed_sections": [],
      "last_runtime": {
        "build_target": "",
        "kind": "local"
      },
      "name": "Probabilistic_Layers_VAE.ipynb",
      "provenance": [
        {
          "file_id": "1KnuTjdi8udCLZDfe9hufjFg01FXDLYHQ",
          "timestamp": 1550986742534
        }
      ],
      "version": "0.3.2"
    },
    "kernelspec": {
      "display_name": "Python 2",
      "name": "python2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
